﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.BoneWeight
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>Describes 4 skinning bone weights that affect a vertex in a mesh.</para>
  /// </summary>
  [UsedByNativeCode]
  [Serializable]
  public struct BoneWeight : IEquatable<BoneWeight>
  {
    [SerializeField]
    private float m_Weight0;
    [SerializeField]
    private float m_Weight1;
    [SerializeField]
    private float m_Weight2;
    [SerializeField]
    private float m_Weight3;
    [SerializeField]
    private int m_BoneIndex0;
    [SerializeField]
    private int m_BoneIndex1;
    [SerializeField]
    private int m_BoneIndex2;
    [SerializeField]
    private int m_BoneIndex3;

    /// <summary>
    ///   <para>Skinning weight for first bone.</para>
    /// </summary>
    public float weight0
    {
      get => this.m_Weight0;
      set => this.m_Weight0 = value;
    }

    /// <summary>
    ///   <para>Skinning weight for second bone.</para>
    /// </summary>
    public float weight1
    {
      get => this.m_Weight1;
      set => this.m_Weight1 = value;
    }

    /// <summary>
    ///   <para>Skinning weight for third bone.</para>
    /// </summary>
    public float weight2
    {
      get => this.m_Weight2;
      set => this.m_Weight2 = value;
    }

    /// <summary>
    ///   <para>Skinning weight for fourth bone.</para>
    /// </summary>
    public float weight3
    {
      get => this.m_Weight3;
      set => this.m_Weight3 = value;
    }

    /// <summary>
    ///   <para>Index of first bone.</para>
    /// </summary>
    public int boneIndex0
    {
      get => this.m_BoneIndex0;
      set => this.m_BoneIndex0 = value;
    }

    /// <summary>
    ///   <para>Index of second bone.</para>
    /// </summary>
    public int boneIndex1
    {
      get => this.m_BoneIndex1;
      set => this.m_BoneIndex1 = value;
    }

    /// <summary>
    ///   <para>Index of third bone.</para>
    /// </summary>
    public int boneIndex2
    {
      get => this.m_BoneIndex2;
      set => this.m_BoneIndex2 = value;
    }

    /// <summary>
    ///   <para>Index of fourth bone.</para>
    /// </summary>
    public int boneIndex3
    {
      get => this.m_BoneIndex3;
      set => this.m_BoneIndex3 = value;
    }

    public override int GetHashCode()
    {
      int num1 = this.boneIndex0;
      int hashCode = num1.GetHashCode();
      num1 = this.boneIndex1;
      int num2 = num1.GetHashCode() << 2;
      int num3 = hashCode ^ num2;
      num1 = this.boneIndex2;
      int num4 = num1.GetHashCode() >> 2;
      int num5 = num3 ^ num4;
      num1 = this.boneIndex3;
      int num6 = num1.GetHashCode() >> 1;
      return num5 ^ num6 ^ this.weight0.GetHashCode() << 5 ^ this.weight1.GetHashCode() << 4 ^ this.weight2.GetHashCode() >> 4 ^ this.weight3.GetHashCode() >> 3;
    }

    public override bool Equals(object other) => other is BoneWeight other1 && this.Equals(other1);

    public bool Equals(BoneWeight other)
    {
      int num1;
      if (this.boneIndex0.Equals(other.boneIndex0))
      {
        int num2 = this.boneIndex1;
        if (num2.Equals(other.boneIndex1))
        {
          num2 = this.boneIndex2;
          if (num2.Equals(other.boneIndex2))
          {
            num2 = this.boneIndex3;
            if (num2.Equals(other.boneIndex3))
            {
              num1 = new Vector4(this.weight0, this.weight1, this.weight2, this.weight3).Equals(new Vector4(other.weight0, other.weight1, other.weight2, other.weight3)) ? 1 : 0;
              goto label_6;
            }
          }
        }
      }
      num1 = 0;
label_6:
      return num1 != 0;
    }

    public static bool operator ==(BoneWeight lhs, BoneWeight rhs)
    {
      return lhs.boneIndex0 == rhs.boneIndex0 && lhs.boneIndex1 == rhs.boneIndex1 && lhs.boneIndex2 == rhs.boneIndex2 && lhs.boneIndex3 == rhs.boneIndex3 && new Vector4(lhs.weight0, lhs.weight1, lhs.weight2, lhs.weight3) == new Vector4(rhs.weight0, rhs.weight1, rhs.weight2, rhs.weight3);
    }

    public static bool operator !=(BoneWeight lhs, BoneWeight rhs) => !(lhs == rhs);
  }
}
